package com.example.demoexperiment02;

import config.AutoConfig;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

@Component
public class SimpleTask {
    private final Logger logger = LoggerFactory.getLogger(this.getClass());
    @Async("taskExecutor")
    public void doTask(int i) throws InterruptedException {
        logger.info("Task "+i+" started");
        try {
            Thread.sleep(2100);
        }catch (InterruptedException e){
            e.printStackTrace();
        }
    }

}
